#include "GameTestWnd.h"
#include "GameWindowMgr.h"
#include "MyRender.h"
extern CGameWindowMgr g_kWndMgr;
extern CMyRender g_kRender;

CGameTestWnd::CGameTestWnd(void)
{
	m_kImage.Load("broken.bmp");
	m_kImage2.LoadFromImage(m_kImage,20,20,100,100);
}

CGameTestWnd::~CGameTestWnd(void)
{
}

void CGameTestWnd::OnDraw()
{
	
	g_kRender.DrawRect(m_iAbsX,m_iAbsY,m_iWidth,m_iHeight,0xFF00FF00);
	g_kRender.DrawImage(m_kImage,m_iAbsX + 10,m_iAbsY + 10,100,150,0xFFFFFFFF);
	g_kRender.DrawImage(m_kImage2,m_iAbsX + 50,m_iAbsY + 10,0xFFFFFFFF);
	g_kRender.DrawText(m_kName.c_str(),m_iAbsX,m_iAbsY,0xFFFF0000,MakeFont(FT_YaHei));	
}

void CreateTestWnd( const string& rkName,int iX,int iY,int iWidth,int iHeigth,const string& kUserData /*= ""*/ )
{
	CGameTestWnd* pkWnd = new CGameTestWnd();
	pkWnd->Create(rkName,iX,iY,iWidth,iHeigth,NULL);
	g_kWndMgr.AddWindow(pkWnd);

	return;
}
